/**
 * There are <a href="https://github.com/thinkgem/jeesite">JeeSite</a> code generation
 */
package com.chlitina.store.modules.expert.entity;

import java.util.List;

import javax.persistence.CascadeType;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.OneToMany;
import javax.persistence.OrderBy;
import javax.persistence.Table;

import org.hibernate.annotations.Cache;
import org.hibernate.annotations.CacheConcurrencyStrategy;
import org.hibernate.annotations.NotFound;
import org.hibernate.annotations.NotFoundAction;
import org.hibernate.validator.constraints.Length;

import com.chlitina.store.common.persistence.BaseEntity;
import com.google.common.collect.Lists;

/**
 * 面部护理方案Entity
 * @author lvbo
 * @version 2013-06-07
 */
@Entity
@Table(name = "solution_face")
@Cache(usage = CacheConcurrencyStrategy.READ_WRITE)
public class SolutionFace extends BaseEntity {
	
	private static final long serialVersionUID = 1L;
	private Long id; 		// 护理方案编号
	private String name; 	// 护理方案名称
	private String description; // 护理方案描述
	private int status; //状态信息 0 - 可用 1 - 不可用
	private String usage; // 为客户解决什么问题
	private String skinType; // 本方案所对应的肤质类型
	private String mutexSolutionIds;//与本方案互斥的方案Id
	private int care_times_per_day; //每天保养次数
	
	private List<SolutionFaceAndProduct> productList = Lists.newArrayList();
	private List<SolutionFaceFood> foodList = Lists.newArrayList();
	private List<SolutionFaceCare> careList = Lists.newArrayList();
	private List<SolutionFaceAndCase> caseList = Lists.newArrayList();
	private List<SolutionFaceAndQA> qaList = Lists.newArrayList();
	private List<SolutionFaceProductStep> stepList = Lists.newArrayList();
	private List<SolutionFaceStoreType> storeTypeList = Lists.newArrayList();
	
	public SolutionFace() {
	}

	public SolutionFace(Long id){
		this();
		this.id = id;
	}
	
	@Id
	@GeneratedValue(strategy = GenerationType.IDENTITY)
	public Long getId() {
		return id;
	}

	public void setId(Long id) {
		this.id = id;
	}

	
	@Length(min=1, max=32)
	public String getName() {
		return name;
	}

	public void setName(String name) {
		this.name = name;
	}

	public String getDescription() {
		return description;
	}

	public void setDescription(String description) {
		this.description = description;
	}

	public int getStatus() {
		return status;
	}

	public void setStatus(int status) {
		this.status = status;
	}
	
	@OneToMany(cascade=CascadeType.ALL,fetch=FetchType.LAZY,mappedBy="solutionFace")
	@NotFound(action = NotFoundAction.IGNORE)
	@Cache(usage = CacheConcurrencyStrategy.READ_WRITE)
	public List<SolutionFaceAndProduct> getProductList() {
		return productList;
	}

	public void setProductList(List<SolutionFaceAndProduct> productList) {
		this.productList = productList;
	}
	
	@OneToMany(cascade=CascadeType.ALL,fetch=FetchType.LAZY,mappedBy="solutionFace")
	@NotFound(action = NotFoundAction.IGNORE)
	@Cache(usage = CacheConcurrencyStrategy.READ_WRITE)
	public List<SolutionFaceFood> getFoodList() {
		return foodList;
	}

	public void setFoodList(List<SolutionFaceFood> foodList) {
		this.foodList = foodList;
	}
	
	@OneToMany(cascade=CascadeType.ALL,fetch=FetchType.LAZY,mappedBy="solutionFace")
	@NotFound(action = NotFoundAction.IGNORE)
	@Cache(usage = CacheConcurrencyStrategy.READ_WRITE)
	public List<SolutionFaceCare> getCareList() {
		return careList;
	}

	public void setCareList(List<SolutionFaceCare> careList) {
		this.careList = careList;
	}

	@OneToMany(cascade=CascadeType.ALL,fetch=FetchType.LAZY,mappedBy="solutionFace")
	@NotFound(action = NotFoundAction.IGNORE)
	@Cache(usage = CacheConcurrencyStrategy.READ_WRITE)
	public List<SolutionFaceAndCase> getCaseList() {
		return caseList;
	}

	public void setCaseList(List<SolutionFaceAndCase> caseList) {
		this.caseList = caseList;
	}

	@OneToMany(cascade=CascadeType.ALL,fetch=FetchType.LAZY,mappedBy="solutionFace")
	@NotFound(action = NotFoundAction.IGNORE)
	@Cache(usage = CacheConcurrencyStrategy.READ_WRITE)
	public List<SolutionFaceAndQA> getQaList() {
		return qaList;
	}

	public void setQaList(List<SolutionFaceAndQA> qaList) {
		this.qaList = qaList;
	}
	
	@Column(name="`usage`")
	public String getUsage() {
		return usage;
	}

	public void setUsage(String usage) {
		this.usage = usage;
	}

	@Column(name="skin_type")
	public String getSkinType() {
		return skinType;
	}

	public void setSkinType(String skinType) {
		this.skinType = skinType;
	}

	@Column(name="mutex_solution_id_list")
	public String getMutexSolutionIds() {
		return mutexSolutionIds;
	}

	public void setMutexSolutionIds(String mutexSolutionIds) {
		this.mutexSolutionIds = mutexSolutionIds;
	}

	public int getCare_times_per_day() {
		return care_times_per_day;
	}

	public void setCare_times_per_day(int care_times_per_day) {
		this.care_times_per_day = care_times_per_day;
	}
	
	@OneToMany(cascade=CascadeType.ALL,fetch=FetchType.LAZY,mappedBy="solutionFace")
	@NotFound(action = NotFoundAction.IGNORE)
	@Cache(usage = CacheConcurrencyStrategy.READ_WRITE)
	@OrderBy("step ASC")
	public List<SolutionFaceProductStep> getStepList() {
		return stepList;
	}

	public void setStepList(List<SolutionFaceProductStep> stepList) {
		this.stepList = stepList;
	}
	
	@OneToMany(cascade=CascadeType.ALL,fetch=FetchType.LAZY,mappedBy="solutionFace")
	@NotFound(action = NotFoundAction.IGNORE)
	@Cache(usage = CacheConcurrencyStrategy.READ_WRITE)
	public List<SolutionFaceStoreType> getStoreTypeList() {
		return storeTypeList;
	}

	public void setStoreTypeList(List<SolutionFaceStoreType> storeTypeList) {
		this.storeTypeList = storeTypeList;
	}
}


